home *** CD-ROM | disk | FTP | other *** search
- 1 goto910
- 2 print"X[169][141][169][141]x{$60} [234][255][169][255][133][145]l4[234]X[169]1[141][169][234][141]x{$60}
- 3 [153]"Xstepginputstopstepinputonx{$60} (NULL)(NULL)step(NULL)inputlistlx(NULL)Xstepuinputstopstep(NULL)inputonx{$60}
- 4 print"XHHH[170]H[168]HHHHHHH[152]h[138]hx{$60}
- 5 [153]"HHHHHHH{$60}
- 6 print"[160][255][200][132][251][169][216][133][252] [241][183][138][162][160][255][200][145][251][136][208][251][230][252][202][208][246]{$60}
- 7 [153]"newclose(NULL)left$>(NULL)on(NULL)let(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)mid$(NULL)(NULL){$60}
- 35 ifuw=0thensysuu,15
- 40 pokeuc,0:pokeun,0:ur$="":ui$="":iful=0thenul=39
- 45 getui$:ifui$=""then45
- 50 ua=asc(ui$):ur=len(ur$):ifua=13andur>0thenpokeuc,1:print" [157]";:goto70
- 55 ifua=20thenon-(ur=0)goto45:ur$=left$(ur$,ur-1):print"[157] [157][157]";:goto45
- 60 ifur=ulthen45
- 65 gosub95:ur$=ur$+ui$:printui$;:goto45
- 70 ifur$=ux$thenprint"[157] ";:goto145
- 75 forui=urto1step-1:ifmid$(ur$,ui,1)=" "thennext
- 80 ur$=left$(ur$,ui):print:return
- 95 iflen(us$)=0then110
- 100 forui=1tolen(us$):ifui$<>mid$(us$,ui,1)thennext:ui$=""
- 105 return
- 110 ifua=46thenreturn
- 115 ifua=32andur<>0thenreturn
- 120 ifua>47andua<58thenreturn
- 125 ifua>64andua<91thenreturn
- 130 ifua<193orua>218thenui$="":return
- 135 ifpeek(ut)=uu%thenui$=chr$(ua-128)
- 140 return
- 145 gosub170:poke251,0:poke252,us/256:poke253,0:poke254,uf:sysuv
- 150 uz=1:uv%=peek(ut):goto300
- 155 uz=0:us$=uj$:ug$=uk$:ut$=ul$:up=uj:ul=uk:print"[147]";:ifuw=0thenpokeuy,6:pokeux,14
- 160 pokeut,uv%:poke251,0:poke252,uf:poke253,0:poke254,us/256:sysuv:ifuw=0thensysuu,15
- 165 pokeu1,u1%:pokeu2,u2%:pokeu3,u3%-1:pokeu4,u4%:goto35
- 170 u1%=peek(u1):u2%=peek(u2):u3%=peek(u3):u4%=peek(u4)
- 175 uj$=us$:uk$=ug$:ul$=ut$:uj=up:uk=ul:return
- 300 print"[147]":pokeut,uu%:ifuw=0thenpokeuy,12:pokeux,6
- 305 print" m e n u"
- 310 print" --------------------------------"
- 315 print" 1. begin hi-q"
- 320 print" 2. student instructions"
- 325 print" 3. teacher instructions"
- 330 print" 4. quit"
- 335 print" --------------------------------"
- 340 print" press a number key (1-4) ";
- 345 ul=1:us$="1234"
- 347 gosub35:us$=""
- 350 onval(ur$)gosub1000,400,500,390
- 355 goto300
- 370 ifuz=1thensysup%:goto155
- 375 return
- 390 sysue:print"[154][147]":ifuw=0thenpokeuy,6:pokeux,14:sysuu,14
- 395 clr:end
- 400 print"[147]":pokeut,ul%:ifuw=0thenpokeuy,11:pokeux,12
- 405 ut$=" [200]i-[209]":uh=1:up=0:ug$="[211]tudent [201]nst"
- 407 gosub3050
- 410 ut$=" hi-q":uh=1:ug$="student inst":print"[147]":pokeut,uu%:gosub850
- 411 print " [209] [209] [209]"
- 412 print " 13 14 15":printtab(25)"this is "
- 413 print " [209] [209] [209] the playing"
- 414 print " 23 24 25 board ":print
- 415 print " [209][160][160][160][209][160][160][160][209][160][160][160][209][160][160][160][209][160][160][160][209][160][160][160][209]"
- 416 print " 31 32 33 34 35 36 37":print
- 417 print " [209][160][160][160][209][160][160][160][209][160][160][160][209][160][160][160][209][160][160][160][209] [160][160][209]"
- 418 print " 41 42 43 44 45 46 47":print
- 419 print " [209][160][160][160][209][160][160][160][209][160][160][160][209][160][160][160][209][160][160][160][209][160][160][160][209]"
- 420 print " 51 52 53 54 55 56 57":print
- 421 print " [209][160][160][160][209][160][160][160][209]"
- 422 print " 63 64 65":print
- 423 print " [209][160][160][160][209][160][160][160][209]"
- 424 print " 73 74 75":print
- 485 gosub835
- 490 ifuz=1thensysup%:goto155
- 495 return
- 500 print"[147]":pokeut,ul%:ifuw=0thenpokeuy,2:pokeux,10
- 501 ut$=" [200]i-[209]":uh=1:up=0:ug$="[212]eacher [201]nst":gosub850
- 502 print" [212]o the best of our knowledge,"
- 503 print" this program is in the public"
- 504 print" domain. [201]f this is not true,"
- 505 print" please contact:"
- 506 print" [195][207][205][205][207][196][207][210][197][160][194][213][211][201][206][197][211][211][160][205][193][195][200][201][206][197][211]"
- 507 print" 3370 [208]harmacy [193]ve.
- 508 [153]" atngincourt, (NULL)ntario"
- 509 [153]" lenanada, (NULL)1(NULL) 2(NULL)4"
- 510 [153]" (416) 499-4292"
- 511 uh[178]1:[141]835:[141]850
- 512 [153]" (NULL)rogram (NULL)ame: left$i-(NULL)"
- 513 [153]" (NULL)ritten by : "
- 514 [153]" (NULL)evised by : lenhris (NULL)aiskums"
- 515 [153]" (NULL)his program will run on any
- 516 print" [194][193][211][201][195][160]2.0 [208][197][212] [195]omputer
- 517 [153]" peekatn(NULL)right$len 4.0 (NULL)val(NULL)closelenomputer
- 518 print" 8032 [195][194][205] [195]omputer
- 519 [153]" lenommodore 64 lenomputer
- 585 gosub835
- 590 ifuz=1thensysup%:goto155
- 595 return
- 700 printuc$"[147]before running this program on an 8032
- 705 [153]" load the 'cbm 4032' program":[128]
- 800 [153]"load";:[151]ut,uu%:[139]uw[178]0[167][151]uy,1:[151]ux,14
- 801 [129]i[178]1[164]38:[153]" wait";:[130]
- 802 [129]i[178]1[164]22:[153]"cmd wait";:[130]
- 803 [129]i[178]1[164]37:[153]"cmdcmd wait";:[130]
- 804 [129]i[178]1[164]22:[153]"oncmd wait";:[130]
- 805 [153]"step wait
- 806 print" [146] [146][169]
- 807 [153]" wait tab((NULL)wait o m m o d o r e
- 808 print"[223] [146]
- 809 [153]"educational
- 810 print"software
- 811 [153]"1983
- 812 printleft$(ud$,24);"press space bar or wait[146]"uc$:ui=0
- 813 getui$:ifui$<>" "thenui=ui+1:ifui<250then813
- 814 goto300
- 835 pokeun,0:printleft$(ud$,24);"press space bar to continue[146]"
- 840 getui$:ifui$<>" "then840
- 845 return
- 850 up=up+1:print"[147]"left$(ut$+up$,21);right$(up$+ug$+str$(up),18)
- 851 ifuw=0thensysuu,15
- 855 print" --------------------------------------"
- 860 ifuh=0thenprintleft$(ud$,24);left$(up$,7);"help - press h <return>"
- 865 uh=0:print"":return
- 875 printleft$(ud$,24);" one moment please... ":return
- 900 ux$="h":us=32768:u1=196:u2=197:u3=198:u4=216:uc=167:ub=1024:ud=1084:ue=1105
- 901 ut=59468:uu%=12:ul%=14:up%=1158:un=158:poke50003,0:uw=peek(50003):uf=peek(53)
- 902 ifuw=0thenus=1024:u1=209:u2=210:u3=211:u4=214:uc=204:ub=2048:ux=53280:ud=2064
- 903 ifuw=0thenut=53272:uu%=21:ul%=23:up%=2151:un=198:uy=53281:uu=2199:ue=2087
- 904 uc$=chr$(155):uv=1214:ifuw=0thenuf=196:uv=2238
- 905 ud$="":up$=" "
- 906 dimb(70),t(9,9),b1(33),b2(33)
- 907 def fnpv(a)=int(us+214+(int(a/10)-1)*80+((a/10-int(a/10))*10-1)*2+.5)
- 909 return
- 910 gosub900:print"[147]":print"[160]":rem shifted space
- 915 ifpeek(us+40)<>96then700
- 920 if(fre(0)-(sgn(fre(0))<0)*65536)>500then935
- 925 printuc$"[147]this machine does not have enough"
- 930 print"memory to run this program !":end
- 935 print"[147]"uc$:ifuw=0then965
- 940 ifuf=60oruf=108oruf=124then950
- 945 poke52,0:poke53,uf-4:clr:gosub900
- 950 ifuw=160thenpoke1103,88:poke1104,228:poke1107,85:poke1111,228:goto965
- 955 ifuw<>1thenprint"[147]this pgm will not work on this machine!":end
- 960 poke1103,49:poke1104,230:poke1107,46:poke1111,230:goto965
- 965 sysud
- 970 gosub800:goto300
- 1000 ifuz=1thensysup%:sysup%:uz=0
- 1001 print"[147]"uc$;:restore:ifuw=0thenpokeuy,6:pokeux,14
- 1050 rem revised by tom ferguson
- 1055 gosub875
- 1060 ct=-1
- 1070 goto1320
- 1100 poke ut,peek(ut) and 253 or 12
- 1110 print"[147]hi-q":print:print:printtab(13)"copyright by"
- 1120 print:print:print tab(10);"creative computing":print tab(12);"p.o. box 789-m"
- 1130 print tab(5);"morristown, new jersey 07960":k=ti
- 1140 if ti<k+200 and k<=ti then 1140
- 1150 return
- 1320 rem *** set up board
- 1330 for r=1 to 9
- 1340 for c=1 to 9
- 1350 if (r-4)*(r-5)*(r-6)=0 then 1390
- 1360 if (c-4)*(c-5)*(c-6)=0 then 1390
- 1370 t(r,c)=-5
- 1380 goto 1410
- 1390 if (r-1)*(c-1)*(r-9)*(c-9)=0 then 1370
- 1400 t(r,c)=5
- 1410 next c
- 1420 next r
- 1430 t(5,5)=0:gosub 1710
- 1440 gosub 2640
- 1450 rem *** input move and chech on legality
- 1460 for w=1 to 33
- 1470 read m
- 1480 data 13,14,15,22,23,24,29,30,31,32,33,34,35,38,39,40,41
- 1490 data 42,43,44,47,48,49,50,51,52,53,58,59,60,67,68,69
- 1500 b(m)=-7:next w
- 1510 b(41)=-3
- 1520 printleft$(ud$,18):forgp=1to5:printup$:nextgp:printleft$(ud$,18)
- 1522 print " move which piece? [157][157]";
- 1525 ul=2:us$="h1234567":gosub35:z=val(ur$):p1=z
- 1530 b4=z:gosub 2750:z=b4
- 1540 if b(z)=-7 then 1590
- 1550 printtab(25)"[145]illegal move":k=ti
- 1560 if ti < k+200 then 1560
- 1570 printtab(25)"[145] "
- 1580 goto 1522
- 1590 print " to where? [157][157]";
- 1595 ul=2:us$="h1234567":gosub35:p=val(ur$):p2=p
- 1600 b4=p:gosub 2750:p=b4
- 1610 if b(p)<>0 then 1620
- 1611 printtab(25)"[145]illegal move":k=ti
- 1612 if ti < k+200 then 1612
- 1613 printtab(25)"[145] [145][145]"
- 1614 goto 1520
- 1620 if b(p)<>-7then 1630
- 1621 goto1611
- 1630 if z=p then 1520
- 1640 if ((z+p)/2)=int((z+p)/2) then 1660
- 1650 goto 1611
- 1660 if (abs(z-p)-2)*(abs(z-p)-18) <> 0 then 1611
- 1670 gosub 1960
- 1680 gosub4000
- 1690 gosub 2220
- 1700 goto 1520
- 1710 rem *** print board
- 1712 ifct=-1thenprint"[147]"
- 1715 ut$=" hi-q":ug$="":ct=ct+1:up=ct:gosub850
- 1720 print "";
- 1725 print"";
- 1730 for b4=1 to 7
- 1740 print tab(((b4)*2)+11);str$(b4);
- 1750 next b4
- 1760 print "[145]"
- 1770 for x=1 to 9
- 1780 if x-1 = 0 then 1810
- 1790 if x-1 > 7 then 1810
- 1800 print tab(11);str$(x-1);
- 1810 for y=1 to 9
- 1820 if (x-1)*(x-9)*(y-1)*(y-9)=0 then 1850
- 1830 if (x-4)*(x-5)*(x-6)=0 then 1870
- 1840 if (y-4)*(y-5)*(y-6) =0 then 1870
- 1850 rem
- 1860 goto 1910
- 1870 if t(x,y) <> 5 then 1900
- 1880 print tab((y*2)+10);"[209]";
- 1890 goto 1910
- 1900 print tab((y*2)+10);"[215]";
- 1910 rem
- 1920 next y
- 1930 print:print
- 1940 next x
- 1950 return
- 1960 rem *** update boards:
- 1970 c=1:for x=1 to 9
- 1980 for y=1 to 9
- 1990 if c <> z then 2180
- 2000 if c+2 <> p then 2050
- 2010 if t(x,y+1)=0 then 1611
- 2020 t(x,y+2)=5
- 2030 t(x,y+1)=0:b(c+1)= -3
- 2040 goto 2160
- 2050 if c+18 <> p then 2090
- 2060 if t(x+1,y)=0 then 1611
- 2070 t(x+2,y)=5:t(x+1,y)=0:b(c+9)=-3
- 2080 goto 2160
- 2090 if c-2 <> p then 2130
- 2100 if t(x,y-1)=0 then 1611
- 2110 t(x,y-2)=5:t(x,y-1)=0:b(c-1)=-3
- 2120 goto 2160
- 2130 if c-18 <> p then 2180
- 2140 if t(x-1,y)=0 then 1611
- 2150 t(x-2,y)=5:t(x-1,y)=0:b(c-9)=-3
- 2160 b(z)=-3:b(p)=-7
- 2170 t(x,y)=0:goto 2210
- 2180 c=c+1
- 2190 next y
- 2200 next x
- 2210 return
- 2220 rem *** check if game is over.
- 2230 f=0
- 2240 for r=2 to 8
- 2250 for c=2 to 8
- 2260 if t(r,c)<>5 then 2440
- 2270 f=f+1
- 2280 for a=r-1 to r+1
- 2290 t=0
- 2300 for b=c-1 to c+1
- 2310 t=t+t(a,b)
- 2320 next b
- 2330 if t <> 10 then 2350
- 2340 if t(a,c) <> 0 then 2590
- 2350 next a
- 2360 for x=c-1 to c+1
- 2370 t=0
- 2380 for y=r-1 to r+1
- 2390 t=t+t(y,x)
- 2400 next y
- 2410 if t <> 10 then 2430
- 2420 if t(r,x) <> 0 then 2590
- 2430 next x
- 2440 next c
- 2450 next r
- 2460 rem *** game is over.
- 2470 gosub850:print" the game is over."
- 2480 print" you had";f;"pieces remaining."
- 2490 if f <> 1 then 2520
- 2500 print " bravo! you made a perfect score!"
- 2510 rem
- 2520 print " play again? ";
- 2530 ul=1:us$="hyn":gosub35:a$=ur$
- 2540 if a$="n"thenreturn
- 2560 print"[147]";
- 2570 restore: goto 1320
- 2580 stop
- 2590 return
- 2640 rem
- 2650 for b3=1 to 33
- 2660 read b1(b3)
- 2670 next b3
- 2680 for b3=1 to 33
- 2690 read b2(b3)
- 2700 next b3
- 2710 restore
- 2720 return
- 2730 data 13,14,15,23,24,25,31,32,33,34,35,36,37
- 2740 data 41,42,43,44,45,46,47,51,52,53,54,55,56,57,63,64,65,73,74,75
- 2750 rem
- 2760 for b3=1 to 33
- 2770 if b2(b3)=b4 then 2810
- 2780 next b3
- 2790 b4=0
- 2800 return
- 2810 b4=b1(b3)
- 2820 goto 2800
- 2830 rem
- 2840 print "press the space-bar to continue."
- 2850 geta$:ifa$<>" "then2850
- 2860 print "[147]";
- 2870 return
- 2880 rem: instructions and explanation
- 2890 rem: of board and how to enter
- 2900 rem: responses.
- 2910 up=3:pokeut,ul%:gosub850:print" [212]o enter a peg number, type its"
- 2920 print " row number and its column number":print" as one number."
- 2930 print " [198]or example:":print " the topmost,";
- 2940 print " leftmost peg is 13."
- 2950 print " [212]he middle of the board":print" (which will be empty at first)";
- 2960 print " is 44."
- 2970 print " [212]he lowest, rightmost peg is 75."
- 2980 gosub835:up=4:gosub850:print" [217]ou will first be asked
- 2985 [153]" the location of a peg to be moved.
- 2990 print" ('move which piece?')"
- 3000 print" then you will be asked for the":print" destination."
- 3010 print" ('to where?')"
- 3020 print:print" [215]hen the board is printed, there will"
- 3030 print" be guides to help you select a peg."
- 3035 gosub835
- 3040 return
- 3050 rem
- 3055 up=0:pokeut,ul%:gosub850
- 3060 print" [212]his is a computerized version"
- 3070 print" of an old [197]uropean solitaire game of"
- 3080 print" logic called [200][201]-[209]. [212]he game starts"
- 3090 print" with a pegboard shaped like a cross"
- 3100 print" having pegs in all holes but the "
- 3110 print" center. [212]he object of this game is"
- 3120 print" to remove all 32 pegs, or as many as"
- 3130 print" possible, by jumping into an empty"
- 3140 print" hole--the jumped peg is then removed."
- 3165 gosub835:pokeut,uu%
- 3170 return
- 4000 rem move on board
- 4010 v1=fnpv(p1):forg1=1to10
- 4020 pokev1,81
- 4030 forg2=1to20:nextg2
- 4040 pokev1,87
- 4050 forg2=1to20:nextg2
- 4060 nextg1
- 4070 v2=fnpv(p2):forg1=1to10
- 4080 pokev2,87
- 4090 forg2=1to20:nextg2
- 4100 pokev2,81
- 4110 forg2=1to20:nextg2
- 4120 nextg1
- 4130 ifint(p1/10)<>int(p2/10)then4150
- 4140 rp=p1+sgn(p2-p1):goto4160
- 4150 rp=p1+10*sgn(p2-p1)
- 4160 v3=fnpv(rp):pokev3,87
- 4170 return
-